/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ListaEstudianteCedula.java
 *
 * Created on 17/02/2011, 10:12:33 PM
 */
package Pantallas;

import Clases.Estudiante;
import java.util.Iterator;

/**
 *
 * @author Mel
 */
public class ListaEstudianteCedula extends javax.swing.JFrame {

    /** Creates new form ListaEstudianteCedula */
    public ListaEstudianteCedula() {
        initComponents();
        Iterator It;
        It = MenuPrincipal.s1.getEstudiantes().iterator();
        int indice = 0;
        while (It.hasNext())//hasNext()Verifica si hay mas elementos
        {
            Estudiante e = (Estudiante) It.next();//next() consigue el pr�ximo elemento
//		dicho elemento es casteado al tipo de objeto Empleado
            tablatxtced.setValueAt(e.getCedula(), indice, 0);
            tablatxtced.setValueAt(e.getNombre_apellido(), indice, 1);
            indice++;
        }

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        tablatxtced = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        btnSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(null);

        tablatxtced.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Cedula", "Nombre "
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tablatxtced);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(10, 80, 452, 150);

        jLabel1.setText("Listado Por Cedula");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(210, 20, 180, 14);

        btnSalir.setText("Salir");
        btnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirActionPerformed(evt);
            }
        });
        getContentPane().add(btnSalir);
        btnSalir.setBounds(180, 270, 140, 23);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-500)/2, (screenSize.height-360)/2, 500, 360);
    }// </editor-fold>//GEN-END:initComponents

    private void btnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_btnSalirActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new ListaEstudianteCedula().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnSalir;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable tablatxtced;
    // End of variables declaration//GEN-END:variables
}
